package course;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import people.Person;
import people.professor.Professor;
import people.student.Student;
import permission.role.TutorRole;
import course.AbstractCourseType;
import course.Course;

/**
 * @author Andreas Waldherr (e1028787@student.tuwien.ac.at)
 *
 */
public class SimpleTestType extends AbstractCourseType{

	private String examData = "";
	
	public SimpleTestType(String courseID, String courseName, Professor courseLeader) {
		super(courseID, courseName, courseLeader, null, null, null);
	}
	
	public void setExamData(String examData){
		this.examData = examData;
	}
	
	public String getExamData(){
		return this.examData;
	}
	
	@Override
	public String getGrade(int value) {
		String note = "nicht bestanden";
		
		if(value > 50)
			note = "bestanden";
		
		return "your grading: "+note;
	}

	@Override
	public List<String> registrationOptions(Student s) {
		List<String> options = new ArrayList<String>();
		options.add("You are automatically registered for the tests: "+getExamData());
		return options;
	}

	@Override
	public boolean finalizeRegistration(Student s, int index) {
		this.getRegisteredStudents(getCourseLeader()).add(s);
		System.out.println("size after reg: "+this.getRegisteredStudents(getCourseLeader()).size());
		return true;
	}

	@Override
	public boolean isStudentRegistered(Student s) {
		boolean ret = false;
		if(this.getRegisteredStudents(getCourseLeader()).contains(s))
			ret = true;
		System.out.println(this.getRegisteredStudents(getCourseLeader()).contains(s));
		return ret;
		//return this.getRegisteredStudents(getCourseLeader()).contains(s);
	}

	@Override
	public String getInformationForStudent(Student s) {
		return examData;
	}
}